package com.corder.display.util;

import javax.servlet.http.HttpServletRequest;

public class SystemUtil {
	/**
	 * 获取访问者的ip
	 * @param request 
	 */
	public static String getIp(HttpServletRequest request){
		String ip = null;
		if (request.getHeader("x-forwarded-for") == null) { 
	        ip = request.getRemoteAddr(); 
	    } else {
	    	ip = request.getHeader("x-forwarded-for");  
	    }
		return ip;
	}
}
